package com.ruoyi.goodsInfoNew.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.goodsInfoNew.mapper.GoodsCategoryNewMapper;
import com.ruoyi.goodsInfoNew.domain.GoodsCategoryNew;
import com.ruoyi.goodsInfoNew.service.IGoodsCategoryNewService;

/**
 * 商品分类管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-05-22
 */
@Service
public class GoodsCategoryNewServiceImpl implements IGoodsCategoryNewService 
{
    @Autowired
    private GoodsCategoryNewMapper goodsCategoryNewMapper;

    /**
     * 查询商品分类管理
     * 
     * @param categoryId 商品分类管理主键
     * @return 商品分类管理
     */
    @Override
    public GoodsCategoryNew selectGoodsCategoryNewByCategoryId(Long categoryId)
    {
        return goodsCategoryNewMapper.selectGoodsCategoryNewByCategoryId(categoryId);
    }

    /**
     * 查询商品分类管理列表
     * 
     * @param goodsCategoryNew 商品分类管理
     * @return 商品分类管理
     */
    @Override
    public List<GoodsCategoryNew> selectGoodsCategoryNewList(GoodsCategoryNew goodsCategoryNew)
    {
        return goodsCategoryNewMapper.selectGoodsCategoryNewList(goodsCategoryNew);
    }

    /**
     * 新增商品分类管理
     * 
     * @param goodsCategoryNew 商品分类管理
     * @return 结果
     */
    @Override
    public int insertGoodsCategoryNew(GoodsCategoryNew goodsCategoryNew)
    {
        goodsCategoryNew.setCreateTime(DateUtils.getNowDate());
        return goodsCategoryNewMapper.insertGoodsCategoryNew(goodsCategoryNew);
    }

    /**
     * 修改商品分类管理
     * 
     * @param goodsCategoryNew 商品分类管理
     * @return 结果
     */
    @Override
    public int updateGoodsCategoryNew(GoodsCategoryNew goodsCategoryNew)
    {
        goodsCategoryNew.setUpdateTime(DateUtils.getNowDate());
        return goodsCategoryNewMapper.updateGoodsCategoryNew(goodsCategoryNew);
    }

    /**
     * 批量删除商品分类管理
     * 
     * @param categoryIds 需要删除的商品分类管理主键
     * @return 结果
     */
    @Override
    public int deleteGoodsCategoryNewByCategoryIds(Long[] categoryIds)
    {
        return goodsCategoryNewMapper.deleteGoodsCategoryNewByCategoryIds(categoryIds);
    }

    /**
     * 删除商品分类管理信息
     * 
     * @param categoryId 商品分类管理主键
     * @return 结果
     */
    @Override
    public int deleteGoodsCategoryNewByCategoryId(Long categoryId)
    {
        return goodsCategoryNewMapper.deleteGoodsCategoryNewByCategoryId(categoryId);
    }
}
